home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Is this ok: *pointer++ = value ??
- Date: Sun, 07 Jan 96 23:26:29 GMT
- Organization: none
- Message-ID: <821057189snz@genesis.demon.co.uk>
- References: <4cklvv$nmm@alcor.usc.edu> <4cmmcd$e3u@gryphon.phoenix.net> <30eefb76.72646976@nntp.ix.netcom.com> <4cn97v$6on@fountain.mindlink.net>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4cn97v$6on@fountain.mindlink.net>
- genew@mindlink.bc.ca "Gene Wirchenko" writes:
-
- >miker3@ix.netcom.com (Mike Rubenstein) wrote:
- >
-
- ...
-
- >>|>> for (i=0; i<50; i++) p++ = i;
-
- ...
-
- >>In what language is it legal? Certainly not C which requires a
- >>modifiable lvalue as the right operand of = and defines p++ as not
- >>being an lvalue.
- >
- >>Michael M Rubenstein
- >
- > Bull! The RIGHT operand requires an L-value? Ha! That would
- >make:
-
- Michael clearly meant 'left' when he wrote 'right' (since he referred to
- p++ which is on the left). Only army C programmers have to know their
- left from their right! :-)
-
- > In the example above,
- > p
- >is the L-value. After being used as such, it is incremented.
-
- And then p++ is used as the left operand of =. = requires an lvalue on
- its LHS which p++ is not, so the expression is illegal (in fact it violates
- a constraint and requires a diagnostic from the compiler).
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-